-
Notifications
You must be signed in to change notification settings - Fork 50
feat(core): Add prepareArtifacts
option for uploading sourcemaps
#794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+214
−84
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
andreiborza
reviewed
Aug 26, 2025
andreiborza
approved these changes
Aug 27, 2025
Lms24
approved these changes
Aug 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds reasonable to me! This opens potential to think about preparation in general (as in, maybe we can stop moving and renaming files all together). Good start!
renovate bot
added a commit
to andrei-picus-tink/auto-renovate
that referenced
this pull request
Sep 1, 2025
| datasource | package | from | to | | ---------- | ------------------- | ----- | ----- | | npm | @sentry/vite-plugin | 4.1.1 | 4.2.0 | ## [v4.2.0](https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/HEAD/CHANGELOG.md#420) - feat(core): Add `prepareArtifacts` option for uploading sourcemaps ([#794](getsentry/sentry-javascript-bundler-plugins#794)) - perf: use premove for build clean ([#792](getsentry/sentry-javascript-bundler-plugins#792)) - fix(core): Forward headers option to sentry-cli ([#797](getsentry/sentry-javascript-bundler-plugins#797)) Work in this release contributed by [@liAmirali](https://github.com/liAmirali). Thank you for your contribution!
renovate bot
added a commit
to andrei-picus-tink/auto-renovate
that referenced
this pull request
Sep 2, 2025
| datasource | package | from | to | | ---------- | ------------------- | ----- | ----- | | npm | @sentry/vite-plugin | 4.1.1 | 4.3.0 | ## [v4.3.0](https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/HEAD/CHANGELOG.md#430) - feat(core): Extend deploy option to allow opting out of automatic deploy creation ([#801](getsentry/sentry-javascript-bundler-plugins#801)) - feat(core): No asset globbing for direct upload ([#800](getsentry/sentry-javascript-bundler-plugins#800)) ## [v4.2.0](https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/HEAD/CHANGELOG.md#420) - feat(core): Add `prepareArtifacts` option for uploading sourcemaps ([#794](getsentry/sentry-javascript-bundler-plugins#794)) - perf: use premove for build clean ([#792](getsentry/sentry-javascript-bundler-plugins#792)) - fix(core): Forward headers option to sentry-cli ([#797](getsentry/sentry-javascript-bundler-plugins#797)) Work in this release contributed by [@liAmirali](https://github.com/liAmirali). Thank you for your contribution!
renovate bot
added a commit
to andrei-picus-tink/auto-renovate
that referenced
this pull request
Sep 2, 2025
| datasource | package | from | to | | ---------- | ------------------- | ----- | ----- | | npm | @sentry/vite-plugin | 4.1.1 | 4.3.0 | ## [v4.3.0](https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/HEAD/CHANGELOG.md#430) - feat(core): Extend deploy option to allow opting out of automatic deploy creation ([#801](getsentry/sentry-javascript-bundler-plugins#801)) - feat(core): No asset globbing for direct upload ([#800](getsentry/sentry-javascript-bundler-plugins#800)) ## [v4.2.0](https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/HEAD/CHANGELOG.md#420) - feat(core): Add `prepareArtifacts` option for uploading sourcemaps ([#794](getsentry/sentry-javascript-bundler-plugins#794)) - perf: use premove for build clean ([#792](getsentry/sentry-javascript-bundler-plugins#792)) - fix(core): Forward headers option to sentry-cli ([#797](getsentry/sentry-javascript-bundler-plugins#797)) Work in this release contributed by [@liAmirali](https://github.com/liAmirali). Thank you for your contribution!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem (kinda)
I realised that some of the logic wrapped around the cli calls in the build plugin manager can lead to some hard to debug pitfalls when combining some commands from using just the cli like
sourcemaps inject
. E.g. the rollup plugin for injecting debugIds also injects a sentryDebugIdIdentifier which is basically a helper for more efficiently finding the injected debugId files before uploading them. When you inject debugIds using the cli only instead, there is no sentryDebugIdIdentifier which then leads source maps not being uploaded.Additionally the plugin manager does quite a lot of expensive file reading/writing:
Solution
This PR adds an option for skipping all these preparation tasks for uploading sourcemaps as they are repetitive tasks when we already injected the debugIds earlier using the CLI . When
prepareArtifacts
is set tofalse
, no temp folder is created and no debug file preparation is done. Instead the files are uploaded directly (similar to usingsentry-cli sourcemaps upload
)Hope this makes sense!